module.exports = {
    init: function () {
        let ps = getCurrentPages()
        let page = ps[ps.length - 1]
        page.goTop = function () {
            wx.pageScrollTo({
                scrollTop: 0,
            })
            this.setData({ showTop: false })
        }
    },
    onPageScroll: function (evt) {
        clearTimeout(this.topTimer)
        this.topTimer = setTimeout(() => {
            console.log("---")
            this.setData({
                showTop: evt.scrollTop > 100
            })
            clearTimeout(this.topTimer)
        }, 50)
    }
}